package com.hz.edu.controller;

import com.hz.api.model.request.ApiResponse;
import com.hz.edu.service.TeacherService;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/edu/teacher")
public class TeacherController {

    @Resource
    TeacherService teacherService;

    @PostMapping("/check-score")
    public String checkScore(Integer courseId, Integer studentId, Integer score) {
        int check = teacherService.checkScore(courseId, studentId, score);
        return check > 0 ? ApiResponse.ok(check) : ApiResponse.intError();
    }

}
